/* Tells if a specific file exists */
Parse arg file.                         /* get user input file */
Infile = .stream~new(file)              /* create stream object */

/* Existence test returns either full filename or the null string */

if infile~query('exists') = '' then     /* test if nonexistent */
        .output~lineout('File does not exist')         /* no such file exists */
else
        .output~lineout('File exists')                 /* found the filename */

exit 0